package com.ebelter.seneo.ui.views.birthday;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.HorizontalScrollView;


public class BtHorizontalScrollView extends HorizontalScrollView {

    private OnScrollChangedListener mOnScrollChangedListener;

    public BtHorizontalScrollView(Context context) {
        super(context);
    }

    public BtHorizontalScrollView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public BtHorizontalScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onScrollChanged(int l, int t, int oldl, int oldt) {
        super.onScrollChanged(l, t, oldl, oldt);
        if (mOnScrollChangedListener!=null){
            mOnScrollChangedListener.onScrollChanged(l, t, oldl, oldt);
        }
    }


    public void addOnScrollChangedListener(OnScrollChangedListener mOnScrollChangedListener) {
        this.mOnScrollChangedListener = mOnScrollChangedListener;
    }

    public void removeOnScrollChangedListener(){
        this.mOnScrollChangedListener = null;
    }

    public interface OnScrollChangedListener{
        void onScrollChanged(int l, int t, int oldl, int oldt);
    }
}
